package org.example.infrastructure.repository.orm.database;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.domain.model.entity.url.UrlShortenerDeviceStats;
import org.example.domain.model.entity.url.req.UrlShortenerGroupStatsReq;
import org.example.domain.model.entity.url.req.UrlShortenerStatsReq;
import org.example.domain.repository.UrlShortenerDeviceStatsRepository;
import org.example.infrastructure.persistence.orm.UrlShortenerDeviceStatsMapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
@RequiredArgsConstructor
public class MybatisUrlShortenerDeviceStatsRepository implements UrlShortenerDeviceStatsRepository {
    private final UrlShortenerDeviceStatsMapper urlShortenerDeviceStatsMapper;

    @Override
    public void insertUrlShortenerDeviceStats(UrlShortenerDeviceStats urlShortenerDeviceStats) {
        urlShortenerDeviceStatsMapper.insertUrlShortenerDeviceStats(urlShortenerDeviceStats);
    }

    @Override
    public List<UrlShortenerDeviceStats> deviceStatsByUrlShortenerList(UrlShortenerStatsReq urlShortenerStatsReq) {
        return urlShortenerDeviceStatsMapper.deviceStatsByUrlShortenerList(urlShortenerStatsReq);
    }

    @Override
    public List<UrlShortenerDeviceStats> deviceStatsByGroupList(UrlShortenerGroupStatsReq urlShortenerGroupStatsReq) {
        return urlShortenerDeviceStatsMapper.deviceStatsByGroupList(urlShortenerGroupStatsReq);
    }
}
